Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: resharding - tests for missing chunks #10052

Merged
merged 3 commits into from
Oct 31, 2023
Merged

Conversation

wacban
Copy link
Contributor

@wacban wacban commented Oct 31, 2023

  • generalized the missing chunk test
  • added missing chunk test cases to cover the v2 resharding
  • fixed the check for get_next_block_hash_with_new_chunk that didn't work for the V2 resharding
  • fixed validators getting kicked out of the test when missing chunks
    • introduced AllEpochConfigTestOverrides - overrides that allow changing the epoch config in tests

Comment on lines -446 to -448
for chunk in chunks.iter() {
assert_ne!(chunk.height_included(), last_block.header().height());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check was overly ambitious for V2. When testing the V1 resharding, it's all or nothing when it comes to chunk production. In the V2 resharding, which happens to include ChunkOnlyProducers, chunks in a block can be produced by different chunk producers and so some can be present and some missing.

I changed it to have the same condition for both cases, when the shard layout is the same and when it is different. The condition now is that the shards with ids target_shard_ids are missing in all blocks from block_hash to last_block_hash_with_empty_chunk.

Comment on lines +300 to +303
if path.exists() {
std::fs::remove_dir_all(&path)?
}
Ok(())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not relevant to the rest of the PR, without this check it would print some nasty errors

Comment on lines 630 to 631
debug!(target: "client", "{:?} Producing block at height {}, parent {} @ {}, {} new chunks: {:?}", validator_signer.validator_id(),
next_height, prev.height(), format_hash(head.last_block_hash), new_chunks.len(), new_chunks.keys().sorted());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not relevant to the rest of the PR, but useful debug info

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it friendly to grafana tempo:
debug!(target: "client", next_height, prev_height = prev.height(), parent, ..., "Producing block");

@wacban wacban marked this pull request as ready for review October 31, 2023 11:55
@wacban wacban requested a review from a team as a code owner October 31, 2023 11:55
Comment on lines 630 to 631
debug!(target: "client", "{:?} Producing block at height {}, parent {} @ {}, {} new chunks: {:?}", validator_signer.validator_id(),
next_height, prev.height(), format_hash(head.last_block_hash), new_chunks.len(), new_chunks.keys().sorted());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it friendly to grafana tempo:
debug!(target: "client", next_height, prev_height = prev.height(), parent, ..., "Producing block");

@wacban wacban added this pull request to the merge queue Oct 31, 2023
Merged via the queue into master with commit c4092e1 Oct 31, 2023
11 of 12 checks passed
@wacban wacban deleted the waclaw-resharding-tests branch October 31, 2023 14:54
@Longarithm
Copy link
Member

Oh great, I ran into this couple days ago and almost started thinking about a fix.

@wacban
Copy link
Contributor Author

wacban commented Nov 2, 2023

Not sure what exactly is "this" but I'm happy to have helped :)

@Longarithm
Copy link
Member

I want to add a bunch of similar tests for which no resharding is happening. It is pretty convenient check of outgoing receipts handling for stateless validation. But because of broken override it didn't work for latest protocol versions before, now it should work without patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants